package com.wetsion.webdubbo.consumer;

import com.alibaba.dubbo.config.annotation.Reference;
import com.wetsion.webdubbo.api.UserService;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @CLassName: WebdubboConsumerApplication
 * @Author: weixin
 * @Description: TODO
 * @DATE: 2018/12/2 5:56 PM
 * @Version: 1.0
 */
@SpringBootApplication
@RestController
public class WebdubboConsumerApplication {
    public static void main(String[] args) {
        SpringApplication.run(WebdubboConsumerApplication.class, args);
    }

    @Reference(url = "dubbo://localhost:12345", check = false)
    private UserService userService;

    @GetMapping("/hello")
    public String hello(@RequestParam String name) {
        return userService.sayHello(name);
    }
}
